package com.heima.admin.controller.v1;

import com.heima.apis.apuser.IApUserClient;
import com.heima.model.user.dtos.ApUserAuthPageReqDTO;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:Dikk
 * @create: 2023-08-02 08:47
 * @Description: AdminAuthController
 */
@RestController
@RequestMapping("/api/v1/auth")
public class AdminAuthController {

    @Autowired
    private IApUserClient apUserClient;

    /**
     * 审核列表查看
     *
     * @param apUserAuthPageReqDTO
     * @return
     */
    @PostMapping("/list")
    public ResponseResult authList(@RequestBody ApUserAuthPageReqDTO apUserAuthPageReqDTO) {
        return apUserClient.authList(apUserAuthPageReqDTO);
    }

    /**
     * 审核通过
     *
     * @param apUserAuthPageReqDTO
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody ApUserAuthPageReqDTO apUserAuthPageReqDTO) {
        return apUserClient.authPass(apUserAuthPageReqDTO);
    }

    /**
     * 审核失败
     *
     * @param apUserAuthPageReqDTO
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody ApUserAuthPageReqDTO apUserAuthPageReqDTO) {
        return apUserClient.authPass(apUserAuthPageReqDTO);
    }
}
